;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Unset Keybindings ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Unset back-to-indentation.
(global-unset-key (kbd "M-m"))

;; Unset set-mark-command
;; (global-set-key (kbd "C-SPC") 'nil)

;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Set keybindings ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;

;; Set company-mode.
(with-eval-after-load 'company
  (define-key company-active-map (kbd "M-n") nil)
  (define-key company-active-map (kbd "M-p") nil)
  (define-key company-active-map (kbd "C-n") 'company-select-next)
  (define-key company-active-map (kbd "C-p") 'company-select-previous)
  )

;; Key Modifiers.
(when (eq system-type 'windows-nt)
  (setq w32-lwindow-modifier 'super)
  (setq w32-apps-modifier 'hyper)
  (w32-register-hot-key [s-t]))

;; Set Magit
(global-set-key (kbd "M-m g s") 'magit-status)

;; edit key
(global-set-key (kbd "M-p") 'move-line-region-up)
(global-set-key (kbd "M-n") 'move-line-region-down)
(global-set-key (kbd "C-z") 'delete-trailing-whitespace)

;; org mode key
(global-set-key (kbd "C-c c") 'org-capture)
(global-set-key (kbd "C-c b") 'blog-post)
(global-set-key (kbd "C-c p") 'publish-project)

(provide 'damacs-key)
